<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    //日期格式实例
    // YYYY-MM-DDTHH:mm:ss.sssZ
    console.log(Date.parse("2010-01-01 11:12:23.111"));
    console.log(new Date("2010-01-01 11:12:23.111"));
    console.log(new Date().toISOString());

    console.log(Date.parse("2010-01-01T11:12:23.111Z"));
    console.log(new Date("2010-01-01T11:12:23.111Z"));
    console.log(new Date().toISOString());

    //日期格式（无时间）
    console.log(new Date("2001"));
    console.log(new Date("2001-02"));
    console.log(new Date("2001-02-22"));

    //日期和时间格式
    console.log(new Date("1999-11-22T13:17"));
    console.log(new Date("1999-11-22T13:17:11"));
    console.log(new Date("1999-11-22T13:17:11.111"));
    console.log(new Date("1999-11-22T13:17:11.111Z"));

    //时间的比较和运算，内部转换为数字进行比较和运算（从1970年1月1日00:00:00开始计算）
    console.log(new Date("1970-01-01").getTime());
    console.log(new Date("1970-01-02").getTime());
    console.log(new Date("1960-01-02").getTime());
    console.log(new Date("1970-01-02") > new Date("1970-01-01"));
    console.log(new Date("1970-01-02") - new Date("1970-01-01"));
    console.log(new Date((new Date("1970-01-01").getTime())+86400000));

    //时间运算 和 时间综合练习 输出50天后是几月几号，星期几？
  </script>
</body>

</html>